
function createCesium(id) {
    console.log(id+"---createCesium")

    // 设置相机默认范围为自定义区域
    Cesium.Camera.DEFAULT_VIEW_RECTANGLE = Cesium.Rectangle.fromDegrees(
        119.9, 30.7501282784158, 121.33, 31.9645982738191
    );


    // Cesium.Camera.DEFAULT_VIEW_FACTOR = 0


    let viewer = new Cesium.Viewer(id, {
        animation: false,
        fullscreenButton: false,
        geocoder: false,
        homeButton: false,
        infoBox: false,
        sceneModePicker: false,
        // selectionIndicator: false,
        timeline: false,
        navigationHelpButton: false,
        baseLayerPicker: false,
        // navigationInstructionsInitiallyVisible: false,
        // imageryProvider: new Cesium.ArcGisMapServerImageryProvider({

        //   url: "https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"
        // })
    });

    if (Cesium.FeatureDetection.supportsImageRenderingPixelated()) {
        //判断是否支持图像渲染像素化处理
        viewer.resolutionScale = window.devicePixelRatio
    }
    viewer.scene.postProcessStages.fxaa.enabled = true

    // 不显示底图
    // viewer.imageryLayers.get(0).show = false;

    //鼠标右键切换视角
    viewer.scene.screenSpaceCameraController.tiltEventTypes = [
        Cesium.CameraEventType.RIGHT_DRAG,
    ];
    //隐藏原生logo
    viewer._cesiumWidget.creditContainer.style.display = "none";

    viewer.scene.logarithmicDepthBuffer = false;

    //深度检测
    // viewer.scene.globe.depthTestAgainstTerrain = true;
    // viewer.scene.globe.enableLighting = false;
    //显示帧速
    viewer.scene.debugShowFramesPerSecond = true;
    //关闭灯光
    viewer.scene.globe.enableLighting = false;
    //关闭阴影
    viewer.shadows = false;
    //修正光照
    // viewer.scene.light = new Cesium.DirectionalLight({
    //     direction: new Cesium.Cartesian3(0.35492591601301104, -0.8909182691839401, -0.2833588392420772),
    //     // direction: Cesium.Cartesian3.fromDegrees(113.200150, 21.990197, 1000),
    //     // color: Cesium.Color.fromCssColorString("yellow"),
    //     intensity: 1
    // });

    // viewer.scene.skyBox.show = false;
    // viewer.scene.backgroundColor = new Cesium.Color.fromCssColorString(
    //     "#0050A4"
    // );
    viewer.scene.sun.show = false;
    viewer.scene.moon.show = false;
    // viewer.scene.globe.show = false;
    viewer.scene.skyAtmosphere.show = false; //隐藏大气圈


   



    return viewer;

}

export {
    createCesium
}